
Ext.define('js.foundation.FoundationShowZybfysBg', {
    extend: 'Ext.panel.Panel',
    id: 'FoundationShowZybfysBg',
    margin:'10 30 30 30',
    config: {
        layout: {
            type: 'vbox',
            align: 'stretch'
        },
    },

    buttonNum:1,
    initComponent: function () {
        this.dockedItems = [
            {
                dock: 'top',
                xtype: 'toolbar',
                cls:'toolbarStyle',
                style:{
                    background:'#fff',
                    border: '2px solid #5294ee'
                },
                items: [{
                    xtype: 'button',
                    cls: 'buttonsetA',
                    scale: 'medium',
                    id:'djyc',
                    text: '<div id="djycA" style="position: relative;padding: 0 1px 0 0px;margin-top: 11px; height: 27px;width: 51px;border-bottom:2px solid #2672d9"><span id="djyxxx" style="margin-left: -5px;color:#2672d9">地基验槽</span></div>',
                    scale: 'medium',
                    margin:'0 2 0 0',
                    width:240,
                    height:60,
                    scope: this,
                    action_type: 'regionAdd',
                    enterprise_id: this.enterprise_id,
                    handler:function () {
                        let me =  Ext.getCmp('FoundationShowZybfysBg');
                        if(me.buttonNum ===2){
                            Ext.getDom('djyc').style.background='#fff';
                            document.getElementById('djyxxx').style.color='#2672d9';
                            me.buttonNum=1
                        }else{
                            Ext.getDom('djyc').style.background='#fff';
                            document.getElementById('djyxxx').style.color='#2672d9';
                            document.getElementById('djycA').style.borderBottom='2px solid #2672d9';

                            Ext.getDom('ztbf').style.background='#fff';
                            document.getElementById('ztbfAx').style.color='#000';
                            document.getElementById('ztbfA').style.borderBottom='2px solid #fff';

                            Ext.getDom('djjcbf').style.background='#fff';
                            document.getElementById('djjcbfAx').style.color='#000';
                            document.getElementById('djjcbfA').style.borderBottom='2px solid #fff';
                            me.buttonNum=2;

                        }
                        me.removeAll(true);
                        let basicInformationPanel = Ext.create('js.foundation.FoundationShowBg', {
                            margin:'10 10 30 10',
                            storeAll: this.storeAll,
                            PageName:this.PageName,
                            //地基验槽(所属重要分部验收
                            Zstsatus:this.foundation_inspection,
                            engineering_no:this.engineering_no,
                            engineering_name:this.engineering_name,
                            status:4,
                            engineering_id:this.engineering_id,
                        });
                        me.add(basicInformationPanel);
                    }
                },{
                    text: '<div id="djjcbfA" style="position: relative;padding: 0 1px 0 0px;margin-top: 11px; height: 27px;width: 101px;border-bottom:2px solid #2672d9"><span id="djjcbfAx" style="margin-left: -5px;">地基与基础分部</span></div>',
                    cls: 'buttonsetA',
                    id:'djjcbf',
                    scale: 'medium',
                    width:240,
                    height:60,
                    margin:'0 2 0 0',
                    handler: this.refresh,
                    scope: this,
                    handler:function () {
                        let me =  Ext.getCmp('FoundationShowZybfysBg');
                        if(me.buttonNum ===3){
                            Ext.getDom('djjcbf').style.background='#fff';
                            document.getElementById('djjcbfAx').style.color='#2672d9';
                            me.buttonNum=1
                        }else{


                            Ext.getDom('ztbf').style.background='#fff';
                            document.getElementById('ztbfAx').style.color='#000';
                            document.getElementById('ztbfA').style.borderBottom='2px solid #fff';

                            Ext.getDom('djjcbf').style.background='#fff';
                            document.getElementById('djjcbfAx').style.color='#2672d9';
                            document.getElementById('djjcbfA').style.borderBottom='2px solid #2672d9';

                            Ext.getDom('djyc').style.background='#fff';
                            document.getElementById('djyxxx').style.color='#000';
                            document.getElementById('djycA').style.borderBottom='2px solid #fff';
                            me.buttonNum=3;

                        }
                        me.removeAll(true);
                        let basicInformationPanel = Ext.create('js.foundation.FoundationShowBg', {
                            margin:'10 10 30 10',
                            storeAll: this.storeAll,
                            PageName:this.PageName,
                            engineering_no:this.engineering_no,
                            engineering_name:this.engineering_name,
                            status:5,
                            //地基基础分部
                            Zstsatus:this.foundation_based_division,
                            engineering_id:this.engineering_id,
                        });
                        me.add(basicInformationPanel);
                    }
                }, {
                    text: '<div id="ztbfA" style="position: relative;padding: 0 1px 0 0px;margin-top: 11px; height: 27px;width: 51px;border-bottom:2px solid #2672d9"><span id="ztbfAx" style="margin-left: -5px;">主体分部</span></div>',
                    margin:'0 2 0 0',
                    width:240,
                    height:60,
                    id:'ztbf',
                    scale: 'medium',
                    cls: 'buttonsetA',
                    name: 'btnDeleteRegion',
                    handler: this.deleteRegionConfirm,
                    scope: this,
                    handler:function () {
                        let me =  Ext.getCmp('FoundationShowZybfysBg');
                        if(me.buttonNum ===4){
                            Ext.getDom('ztbf').style.background='#fff';
                            document.getElementById('ztbfAx').style.color='#2672d9';
                            me.buttonNum=1
                        }else{
                            Ext.getDom('ztbf').style.background='#fff';
                            document.getElementById('ztbfAx').style.color='#2672d9';
                            document.getElementById('ztbfA').style.borderBottom='2px solid #2672d9';

                            Ext.getDom('djyc').style.background='#fff';
                            document.getElementById('djyxxx').style.color='#000';
                            document.getElementById('djycA').style.borderBottom='2px solid #fff';

                            Ext.getDom('djjcbf').style.background='#fff';
                            document.getElementById('djjcbfAx').style.color='#000';
                            document.getElementById('djjcbfA').style.borderBottom='2px solid #fff';
                            me.buttonNum=4;
                        }
                        me.removeAll(true);
                        let basicInformationPanel = Ext.create('js.foundation.FoundationShowBg', {
                            margin:'10 10 30 10',
                            storeAll: this.storeAll,
                            PageName:this.PageName,
                            engineering_no:this.engineering_no,
                            engineering_name:this.engineering_name,
                            status:6,
                            //主体分部
                            Zstsatus:this.main_division,
                            engineering_id:this.engineering_id,
                        });
                        me.add(basicInformationPanel);
                    }
                }
                ]
            }];
        this.callParent(arguments);
        this.on('afterrender',this.show);
    },
     show:function(){
         let me =  Ext.getCmp('FoundationShowZybfysBg');
         if(me.buttonNum ===2){
             Ext.getDom('djyc').style.background='#fff';
             document.getElementById('djyxxx').style.color='#2672d9';
             me.buttonNum=1
         }else{
             Ext.getDom('djyc').style.background='#fff';
             document.getElementById('djyxxx').style.color='#2672d9';
             document.getElementById('djycA').style.borderBottom='2px solid #2672d9';

             Ext.getDom('ztbf').style.background='#fff';
             document.getElementById('ztbfA').style.color='#000';
             document.getElementById('ztbfA').style.borderBottom='2px solid #fff';

             Ext.getDom('djjcbf').style.background='#fff';
             document.getElementById('djjcbfA').style.color='#000';
             document.getElementById('djjcbfA').style.borderBottom='2px solid #fff';
             me.buttonNum=2;

         }
         me.removeAll(true);
         let basicInformationPanel = Ext.create('js.foundation.FoundationShowBg', {
             margin:'10 10 30 10',
             storeAll: this.storeAll,
             PageName:this.PageName,
             //地基验槽(所属重要分部验收
             Zstsatus:this.foundation_inspection,
             engineering_no:this.engineering_no,
             engineering_name:this.engineering_name,
             status:4,
             engineering_id:this.engineering_id,
         });
         me.add(basicInformationPanel);
     }
});